<?php
if(!ob_start("ob_gzhandler")) ob_start();
?>
<html>
	<head>
		<title>SapMe</title>
		<link rel = "stylesheet" type = "text/css" href = "SapMeStyle.css">
		<link rel="shortcut icon" href="globeicon.ico">
		<link rel = "stylesheet" type = "text/css" href = "jquery-ui-1.8.16.custom.css">
		<script type="text/javascript" src="jquery-1.7.js"></script>
		<script type = "text/javascript" src = "jquery-ui-1.8.16.custom.min.js"></script>
		<script type = "text/javascript" src = "indexJavascript.js"></script>
		<script>
			var ua = $.browser;
			if ( ua.mozilla && ua.version.slice(0,3) < "12" ) 
			{
				window.location="browser.php";
			}
			if ( $.browser.msie ) {
				window.location="browser.php";
			}
			if ( $.browser.opera ) {
				window.location="browser.php";
			}
		</script>
	</head>
	<body>
		<div id = "topBar">
			<div id = "iconsContainer">
				<div class = "icon">
					<img src = "profile.png" class = "barIcons" title = "Profile">
				</div>
				<div class = "icon">
					<img src = "news.png" class = "barIcons" title = "News">
					</div>
				<div class = "icon">
					<img src = "messages.png" class = "barIcons" title = "Messages">
				</div>
			</div>
			<a href = "index.php"><img src = "logo.png" id = "logo" title = "Home"></a>
		</div>
		<div id = "tabular">
		
		<ul>
		<?php
			if((isset($_SESSION['kelesh'])))
				{
					session_unset();
				}
				?>

				
			<li>Select option: </li>
			<li><a href="#tabular-1" id = "loginTab">Log In</a></li>
			<li> OR </li>
			<li><a href="#tabular-2" id = "registerTab">Register</a></li>
		</ul>
		<div id = "tabular-1">
		<div id = "logIn">
			
			<?php 
			if (isset($_REQUEST['id']))
			{
				mysql_connect("localhost", "sapmenet_admin", "a1s2d3f4g5h6j7") or die ("Problem with datebase");
				mysql_select_db("sapmenet_users");
				$_REQUEST['id']=mysql_real_escape_string($_REQUEST['id']);
				mysql_query("UPDATE users SET activated=1 WHERE ID='".$_REQUEST['id']."'");
			}
			if (isset($_REQUEST['ok']))
			{
			$a=htmlspecialchars($_REQUEST['ok']);
			echo ($a);
			}
			?>
			<h1>Log In:</h1>
			<form method = "post" action = "login.php">
				E-mail: <input type = "text" name = "mail"><br>
				Password: <input type = "password" name = "pass"><br>
				<input type = "submit" value = "Log In" class = "formButtons">
			</form>
		</div>
		</div>
		<div id = "tabular-2">
		<div id = "register">
			<h1>Register:</h1>
			<form method = "post" action = "register.php" id = "registerForm">
				First Name: <input type = "text" name = "FirstName" id = "firstName"> <span class = "error" id = "firstNameError">Invalid first name.</span> <br>
				Last Name: <input type = "text" name = "LastName" id = "lastName"> <span class = "error" id = "lastNameError">Invalid last name.</span> <br>
				Password: <input type = "password" name = "password" id = "pass"> <span id = "emptyPassword" class = "emptyError">This can't be empty.</span><br>
				Confirm password: <input type = "password" name = "rePassword" id = "rePass"> <span class = "error" id = "passwordError">Passwords do not match.</span> <br>
				E- mail: <input type = "text" name = "email" id = "email">  <span id = "emptyEmail" class = "emptyError">This can't be empty.</span><br>
				Confirm e- mail: <input type = "text" name = "reEmail" id = "reEmail"> <span class = "error" id = "emailError">E-mails do not match.</span> <br>
				I'm: <select name = "sex">
					<option>Male</option>
					<option>Female</option>
				</select><br>
				Bitrth Date: <input type = "text" name = "date" id = "theDate"> <span id = "emptyDate" class = "emptyError">This can't be empty.</span><br>
				I agree with the <span id = "showTerms">terms of usage</span> of sapme.net <input type = "checkbox" id = "termsAgree"><span id = "dontAgree" class = "emptyError">You must agree with the terms.</span><br>
				<input type = "submit" value = "Register" class = "formButtons"><input type = "reset" value = "Clear" class = "formButtons">
			</form>
		</div>
		</div>
		</div>
		<div id = "termsDialog" title = "Terms of usage.">
			<p>
				- You agree that any information you provide online is your personal data. They will not provide addresses, phone numbers or Internet addresses. Images that you submit must be yours.

- You agree not to send or post materials on the site violating copyrights, trademarks, intellectual property rights of third country laws.

- You agree that you are responsible for or sent your materials published photos, text, data and information on the site.

- You agree that all data are completed manuscript by the user during registration at the site as a service name, alias (nickname) years, address, city, date of birth, description, etc.. except the password will be provided to other users.

- You agree not to use the site for advertising or any other purpose other than use of the site.

- Agree that the user bears the full responsibility for using his username and password to protect their username and password, and they do not become available to third parties. Also, the user bears the full responsibility for all consequences (direct and indirect) incurred by the use of his username and password whether such use is made by the user or a third party.

- Agree that the consumer is obliged to protect the username and password. At the least doubt in the consumer that a third party has access to his profile, the user can change their password.

- You agree that your photos can be used to promote the site.

- You agree that in order to maintain its relevance SITE USERS will erase all data left by them or for them when not using the username for a period greater than six months.

- Agree that the site administrator reserves the right to impose punitive measures on consumers be allowed to violate the foregoing conditions. These measures consist of the warning or delete from the system.

- Agree that the site has the right to prevent publication, wholly or partially contradict the above prohibitions, and to remove any posts without notice.

- Agree that the site is not responsible for the contents of user photos, text, data and information on the site.

- Agree that the site has the right to prevent publication, wholly or partially contradict the above prohibitions, and to remove any posts without notice.

- Agree that the site reserves the right to modify unacceptable profiles with content, to delete profiles and deny access to users at their discretion. This is done to ensure the comfort and tranquility for other users.

- Agree that the site has the right to remove any ads to users if it considers that the publication or portion thereof, does not meet any of the conditions set forth in these Terms. In this case the user loses all the rights that had online. This site has no obligation to restore the registration of such person.

- Agree that the site is not liable for damages resulting from reliance on information or other content placed on the site.

- Agree that the site reserves the right to notify and fully cooperate with the competent authorities, including prosecutors, investigators and police authorities for any content which violates the laws of Bulgaria and / or European Union law.

- Agree that the site may at any time to withdraw from the provision of all or any of the services without any obligations to consumers.

- Agree that the site has the right to change the technology and design of the Services without prior notice.

- Agree that the site reserves the right to send our users announcements of new services, promotions or changes in conditions and methods for using these services.

- You agree that when using the services of the site the user is obliged to comply with these conditions and any other conditions imposed by the laws of the Republic of Bulgaria and international law, even if not specified in these conditions.
			</p>
		</div>
		<div id = "globe">
			<img src  ="globe.png" id = "globePic">
		</div>
	</body>
</html>






































